﻿<UserControl 
        x:Class="DiscoveryLogic.UI.Layouts.Controls.MiniBillGraph"
        xmlns="http://schemas.microsoft.com/client/2007"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:DiscoveryLogic.UI.Layouts.Controls"	 
        xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
        Width="48"
        Height="32">

    <Canvas x:Name="Root"                
        MouseEnter="Graph_MouseEnter"
        MouseLeave="Graph_MouseLeave"
        Background="Transparent"
        >

        <Canvas.RenderTransform>
            <ScaleTransform ScaleX="0.9" ScaleY="0.9"/>
        </Canvas.RenderTransform>
        
        <ItemsControl Canvas.Left="0" Canvas.Top="0" ItemsSource="{Binding MiniBillHistory}" >
            <ItemsControl.ItemsPanel>
                <ItemsPanelTemplate>
                    <StackPanel Orientation="Horizontal" />
                </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <StackPanel VerticalAlignment="Bottom">
                        <Rectangle Loaded="Rectangle_Loaded" Width="8" Height="{Binding BarHeight}" StrokeEndLineCap="Flat" StrokeStartLineCap="Flat" StrokeThickness="1" RadiusX="4" RadiusY="4" Canvas.Top="{Binding BarTop}">
                          <Rectangle.Fill>
                                <LinearGradientBrush x:Name="LGB" EndPoint="4.971,2.064" StartPoint="3.028,2.152" MappingMode="RelativeToBoundingBox">
                                    <LinearGradientBrush.Transform>
                                        <TransformGroup>
                                            <MatrixTransform Matrix="1,0,0,-1,-27.270996,84.062012"/>
                                        </TransformGroup>
                                    </LinearGradientBrush.Transform>
                                    <GradientStop x:Name="BarGradient0" Color="#FFC0DEF4" Offset="0"/>
                                    <GradientStop x:Name="BarGradient1" Color="#FFA0CAEB" Offset="0.341"/>
                                    <GradientStop x:Name="BarGradient2" Color="#FF83B7E2" Offset="0.452"/>
                                    <GradientStop x:Name="BarGradient3" Color="#FF65A3D8" Offset="0.654"/>
                                    <GradientStop x:Name="BarGradient4" Color="#FFC0DEF4" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                    </StackPanel>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
    </Canvas>
</UserControl>